package com.cskaoyan._01introduction;

import java.io.File;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/17 10:21
 **/
/*
构造方法
 */
public class Demo2 {
    public static void main(String[] args) {
        //File (String pathname)
        File file = new File("D:\\app2\\a.jpg");

        // 判断文件是否物理存在
        System.out.println(file.exists());

        File file1 = new File("b.txt");
        System.out.println(file1.exists());


        //File (String parent, Sting child)
        File file2 = new File("D:\\app2", "1.txt");
        System.out.println(file2.exists());

        //File (File parent, String child)
        File file3 = new File(new File("D:\\app2"), "MM.jpg");
        System.out.println(file3.exists());
    }
}
